package com.yugao.fintech.antelope.infra.weixin.mp.model.entity;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.yugao.fintech.antelope.base.model.BasePlusPO;
import com.yugao.fintech.antelope.base.tenant.core.DataIsolation;
import com.yugao.fintech.framework.core.annotations.FieldUnique;
import com.yugao.fintech.framework.core.annotations.FieldUniqueConfig;
import com.yugao.fintech.framework.core.enums.SqlConditionTypeEnum;

/**
 * 公众号标签表
 *

 */
@Getter
@Setter
@TableName("wx_mp_tag")
@FieldUniqueConfig(sqlCondition = SqlConditionTypeEnum.AND)
@DataIsolation(filterTenant = true, tableName = "wx_mp_tag")
public class MpTag extends BasePlusPO {
	/**
	 * 微信的系统标签
	 */
	public static final Long WX_SYS_TAG_ID = 2L;

	/**
	 * 主键
	 */
    @TableId
	private Long id;
	
	/**
	 * 公众号标签 id
	 */
	private Long tagId;
	
	/**
	 * 标签名称
	 */
	@FieldUnique(message = "标签已存在")
	private String name;
	
	/**
	 * 粉丝数量
	 */
	private Integer count;

	/**
	 * 公众号 appId
	 */
	private String mpAppId;
	
	/**
	 * 是否删除
	 */
	@FieldUnique(condition = FieldUnique.Condition.NE, value = "1")
	private Boolean deleted;

    public static LambdaQueryWrapper<MpTag> lqw() {
		return Wrappers.lambdaQuery();
	}
}
